<!DOCTYPE html>

<html>
<head>
  <title>Maybe</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
  <div id="container">
    <div id="background"></div>
    
      <ul id="jump_to">
        <li>
          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
          <a class="small" href="javascript:void(0);">+</a>
          <div id="jump_wrapper">
          <div id="jump_page">
            
              
              <a class="source" href="Array.coffee.html">
                Array.coffee.md
              </a>
            
              
              <a class="source" href="BareObject.coffee.html">
                BareObject.coffee.md
              </a>
            
              
              <a class="source" href="Boolean.coffee.html">
                Boolean.coffee.md
              </a>
            
              
              <a class="source" href="Function.coffee.html">
                Function.coffee.md
              </a>
            
              
              <a class="source" href="Math.coffee.html">
                Math.coffee.md
              </a>
            
              
              <a class="source" href="Maybe.coffee.html">
                Maybe.coffee.md
              </a>
            
              
              <a class="source" href="Nullable.coffee.html">
                Nullable.coffee.md
              </a>
            
              
              <a class="source" href="Number.coffee.html">
                Number.coffee.md
              </a>
            
              
              <a class="source" href="Object.coffee.html">
                Object.coffee.md
              </a>
            
              
              <a class="source" href="Promise.coffee.html">
                Promise.coffee.md
              </a>
            
              
              <a class="source" href="String.coffee.html">
                String.coffee.md
              </a>
            
              
              <a class="source" href="Type.coffee.html">
                Type.coffee.md
              </a>
            
              
              <a class="source" href="header.coffee.html">
                header.coffee.md
              </a>
            
          </div>
        </li>
      </ul>
    
    <ul class="sections">
        
        
        
        <li id="section-1">
            <div class="annotation">
              
              <div class="pilwrap ">
                <a class="pilcrow" href="#section-1">&#182;</a>
              </div>
              <h1 id="maybe">Maybe</h1>

            </div>
            
            <div class="content"><div class='highlight'><pre>	<span class="hljs-built_in">window</span>.Maybe = Function.Cache <span class="hljs-function"><span class="hljs-params">(base)</span> -&gt;</span>
	
		construct = Object.construct base
		valid     = Object.isa base
	
		<span class="hljs-function"><span class="hljs-title">derived</span>       = <span class="hljs-params">(x)</span> -&gt;</span> <span class="hljs-keyword">if</span> arguments.length == <span class="hljs-number">0</span> <span class="hljs-keyword">or</span> <span class="hljs-keyword">not</span> x? <span class="hljs-keyword">then</span> <span class="hljs-literal">undefined</span> <span class="hljs-keyword">else</span> construct arguments...
		derived.<span class="hljs-function"><span class="hljs-title">valid</span> = <span class="hljs-params">(x)</span> -&gt;</span> <span class="hljs-keyword">not</span> x? <span class="hljs-keyword">or</span> valid x
	
		<span class="hljs-keyword">return</span> derived</pre></div></div>
            
        </li>
        
    </ul>
  </div>
</body>
</html>
